<include file="Public/min-header"/>
<script src="__PUBLIC__/js/global.js"></script>
<style>
     .slstyle {height: 40px; width:200px;}
</style>
<div class="wrapper">
   <include file="Public/breadcrumb"/>
    <section class="content">
    <div class="row">
      <div class="col-sm-12">
        <div class="panel panel-default">
            <div class="panel-heading"><h3 class="panel-title"><i class="fa fa-list"></i> 用户信息</h3></div>
            <div class="panel-body">
                <form action="" method="post" onsubmit="return checkUserUpdate(this);">
                    <table class="table table-bordered">
                    <tbody>
                    <tr><td>昵称:</td><td ><input type="text" class="form-control" name="nickname" value="{$user.nickname}"></td><td></td></tr>
                    <tr><td>邮箱:</td><td><input type="text" class="form-control" name="email" value="{$user.email}"></td><td>电子邮箱,可直接用于登录</td></tr>
                    <tr><td>手机:</td><td><input type="text" class="form-control" name="mobile" value="{$user.mobile}"></td><td>手机号,可直接用于登录</td></tr>
                    <tr><td>账号:</td><td><input type="text" class="form-control" name="account" value="{$user.account}"></td><td>账号<b style='color:red;'>唯一性</b>,可直接用于登录</td></tr>
                    <tr><td>微信:</td><td><input class="form-control" type="text" name="weixin" value="{$user.weixin}"></td><td></td></tr>
                    <tr><td>Q Q:</td><td><input class="form-control" type="text" name="qq" value="{$user.qq}"></td><td></td></tr>
                    <tr><td>支付宝:</td><td><input class="form-control" type="text" name="zfb" value="{$user.zfb}"></td><td></td></tr>
                    <tr><td>新登录密码:</td><td><input type="password" class="form-control" name="password"></td><td>留空表示不修改密码</td></tr>
                    <tr><td>确认新登录密码:</td><td><input type="password" class="form-control" name="password2" ></td><td>留空表示不修改密码</td></tr>
                    <tr><td>新交易密码:</td><td><input type="password" class="form-control" name="secpwd" /></td> <td>留空表示不修改密码</td></tr>
                    <tr><td>确认新交易密码:</td><td><input type="password" class="form-control" name="secpwd2" /></td><td>留空表示不修改密码</td></tr>
                    <tr><td>密保问题</td><td><input type="text" class="form-control" name="question" value="{$user.question}"/></td><td></td></tr>
                    <tr><td>问题答案</td><td><input type="text" class="form-control" name="answer" value="{$user.answer}"/></td><td></td></tr>
                    
                    <tr><td>身份证号</td><td><input class="form-control" type="text" name="card" value="{$user.card}"></td><td></td></tr>
                    <tr><td>开户银行:</td><td><input class="form-control" type="text" name="bank_opening" value="{$user.bank_opening}"></td><td>用于提现</td></tr>
                    <tr><td>分行支行:</td><td><input class="form-control" type="text" name="bank_address" value="{$user.bank_address}"></td><td>用于提现</td></tr>
                    <tr><td>银行账号:</td><td><input class="form-control" type="text" name="bank_account" value="{$user.bank_account}"></td><td>用于提现</td></tr>
                    <tr><td>姓名:</td><td><input class="form-control" type="text" name="bank_name" value="{$user.bank_name}"></td><td><b style='color:red;'>用于提现</b></td></tr>
                    
                    <tr>
                        <td>联系地址</td><td>
                            <select class="slstyle form-control" name="province" id="province" onChange="get_city(this)">
                                <option value="0">请选择</option>
                                <volist name="province" id="p">
                                    <option <if condition="$p['id'] eq $user['province']"> selected </if> value="{$p.id}">{$p.name}</option>
                                </volist>
                            </select>
                            <select class="slstyle form-control" name="city" id="city" onChange="get_area(this)">
                                <option value="0">请选择</option>
                                <volist name="city" id="p">
                                    <option <if condition="$p['id'] eq $user['city']"> selected </if>  value="{$p.id}">{$p.name}</option>
                                </volist>
                            </select>
                            <select class="slstyle form-control" name="district" id="district" onChange="get_twon(this)">
                                <option value="0">请选择</option>
                                <volist name="district" id="p">
                                    <option <if condition="$p['id'] eq $user['district']"> selected </if> value="{$p.id}">{$p.name}</option>
                                </volist>
                            </select>
                            <select class="slstyle form-control" <if condition="$user['city'] eq ''"> style="display:none;"  </if>  name="twon" id="twon">
                                <volist name="twon" id="p">
                                    <option value="{$p.id}">{$p.name}</option>
                                </volist>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>性别:</td><td id="order-status">
                            <input name="sex" type="radio" value="0" <if condition="$user['sex'] eq 0">checked</if> >保密
                            <input name="sex" type="radio" value="1" <if condition="$user['sex'] eq 1">checked</if> >男
                            <input name="sex" type="radio" value="2" <if condition="$user['sex'] eq 2">checked</if> >女
                        </td><td></td>
                    </tr>
                    <tr><td>注册时间:</td><td>{$user.reg_time|date='Y-m-d H:i',###}<span style="margin-left:50px;">激活时间：{$user.jh_time|date='Y-m-d H:i',###}</span></td><td></td></tr>
                    
                       
                    <tr>
                        <td></td>
                        <td>
                            <button type="submit" class="btn btn-info"><i class="ace-icon fa fa-check bigger-110"></i> 保存</button>
                            <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default pull-right" data-original-title="返回"><i class="fa fa-reply"></i></a>
                        </td>
                    </tr>
                    </tbody>
                </table>
                </form>

            </div>
        </div>
 	  </div> 
   </section>
</div>
<script>
    function checkUserUpdate(){
        var email = $('input[name="email"]').val();
        var mobile = $('input[name="mobile"]').val();
        var password = $('input[name="password"]').val();
        var password2 = $('input[name="password2"]').val();
        var secpwd = $('input[name="secpwd"]').val();
        var secpwd2 = $('input[name="secpwd2"]').val();

        var error ='';
        if(password != password2){
            error += "两次密码不一样\n";
        }
        if (secpwd != secpwd2)
        {
            error += "两次交易密码输入不一样\n";
        }

        if(!checkEmail(email)){
            error += "邮箱地址有误\n";
        }
        if(!checkMobile(mobile)){
            error += "手机号码填写有误\n";
        }
        if(error){
            layer.alert(error, {icon: 2});  //alert(error);
            return false;
        }
        return true;

    }
</script>

</body>
</html>